#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;
#include <vector>
#include <set>

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> p(n);
	vector<set<int>> fun(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i];
		int sz = 0;
		cin >> sz;
		for (int j = 0; j < sz; j++) {
			int f = 0;
			cin >> f;
			fun[i].insert(f);
		}
	}
	for(int i = 0; i < p.size(); i++){ 
		for (int j = i + 1; j < p.size(); j++) {
			int flag = 1;
			if (p[i] <= p[j]) {
				for (auto e : fun[j]) {
					if (fun[i].count(e) == 0) {
						flag = 0;
						break;
					}
				}
				if (flag && (p[i] < p[j] || fun[i].size() > fun[j].size())) {
					cout << "Yes" << endl;
					return 0;
				}
			}
		}
	}
	cout << "No" << endl;
	return 0;
}